<template>
    <div class="page_body">
      <!-- <HomeTop :topTitle="topTitle"></HomeTop> -->
      <div class="empty_box" v-if="!siginin_list.length">
        <div>
          <img
            class="empty_img"
            src="../../assets/image/empty_icon01.png"
            alt=""
          />
          <div class="empty_title">暂无签到记录</div>
        </div>
      </div>
      <div class="page_list" v-else>
        <div class="sign_list" v-for="(item,index) in siginin_list" :key="index">
          <div class="sign_day">日期 : {{ item.signin_Ymd }}</div>
          <div class="sign_time">
            <div class="title">时间 :</div>
            <div class="time">{{ item.signin_His }}</div>
            <div class="status">已签到</div>
          </div>
        </div>
      </div>
      <div class="page_bottom">
        <van-tabbar route>
          <van-tabbar-item replace :to="`/enroll/coach/sign?id=${id}`"  icon="map-marked"
            >签到</van-tabbar-item
          >
          <van-tabbar-item replace :to="`/enroll/coach/signDetailList?id=${id}`" icon="label"
            >签到记录</van-tabbar-item
          >
        </van-tabbar>
      </div>
    </div>
  </template>
  <style src="../../assets/css/enroll/coachSignDetailList.css" scoped></style>
  
  <script>
  import HomeTop from "@/components/homeTop.vue";
  import { Indicator, Toast } from "mint-ui";
  import { Dialog, Tabbar, TabbarItem } from "vant";
  export default {
    name: "signList",
    components: {
      HomeTop,
      [Tabbar.name]: Tabbar,
      [TabbarItem.name]: TabbarItem,
    },
    data() {
      return {
        topTitle: "签到记录",
        siginin_list: [],
        active: 0,
        id:''
      };
    },
    created() {
      this.id = this.$route.query.id
      this.getSignList();
    },
    methods: {
      //比赛名称以及详情
      getSignList() {
        let url = "/mobile/signinList";
        let data = {
          id: this.id,
        };
        Indicator.open();
        this.axios
          .post(url, data)
          .then((res) => {
            Indicator.close();
            if (res.code == 0) {
              this.siginin_list = res.siginin_list;
            } else {
              Toast({
                message: res.msg,
                duration: 3000,
              });
            }
          })
          .catch(function (error) {
            Indicator.close();
            console.log(error);
          });
      },
    },
  };
  </script>
  